Conversation
| px="2" | ||
| mx="2" | ||
| as={NavLink} | ||
| as={url ? NavLink : null} |
There was a problem hiding this comment.
In teleterm we don't have classical routing, so rendering NavLink causes errors (that it should be used in context of Router)
| px="2" | ||
| mx="2" | ||
| as={NavLink} | ||
| as={url ? NavLink : null} |
There was a problem hiding this comment.
Could we change it so that instead of rendering a div when there's no URL it renders a button styled as a link instead? This actually provides keyboard support OOTB and helps us avoid having onClicks on divs.
There was a problem hiding this comment.
Done, I had to add Flex container to the items in menu, because Button was going outside ofMenu.
| onClick={() => { | ||
| connect(serverUri); | ||
| <MenuSshLogin | ||
| menuListCss={menuListCss} |
There was a problem hiding this comment.
I've been here for just two months, so I suppose @kimlisa might have something more to say. But long-term, injecting arbitrary CSS seems to me like a wrong way of modifying the appearance of a shared component.
Ideally I suppose everything should work OOTB after we change the theme in Teleterm. However, I noticed that the way we use the theme is color-oriented rather than purpose-oriented.
webapps/packages/shared/components/MenuSshLogin/MenuSshLogin.tsx
Lines 130 to 137 in 0b65709
webapps/packages/design/src/Menu/MenuList.jsx
Lines 32 to 33 in 0b65709
I might be wrong, but I think this makes it harder to reuse components, because theme.colors.light might mean different things in different contexts. I saw a good thread about that a couple of days ago which goes into detail about this issue.
OTOH, taking care of that is probably out of scope for this PR.
One solution which comes to my mind is having a special copy of the theme in Teleterm which will override the Teleterm theme in places like this one here where we really need to bend a shared component to make it look a certain way. This means that in this context theme.colors.light could be something entirely else than it is in the general Teleterm theme. What do you think about this idea?
There was a problem hiding this comment.
i honestly don't have strong opinions on this matter :)
and if i understood you correctly, i think we do something similar to what you suggested where we use our own custom colors (our console view theme is darker than our normal teleport theme):
There was a problem hiding this comment.
Thanks for detailed comment, I agree!
I chose the way with css styling to apply more complicated changes like: different border radius, no separator between items, rounded corners of hovered item.
However, since we have agreed that color customization is sufficient, styling using a provider is simple.
6c07d21 to
07987d0
Compare
ravicious
left a comment
There was a problem hiding this comment.
Ran into some problems when testing how this change impacts the web UI.
| border-radius: 4px; | ||
| box-sizing: border-box; | ||
| color: #263238; | ||
| color: ${theme.colors.blueGrey[900]}; |
There was a problem hiding this comment.
I wanted to check if the change from <React.Fragment> to <Flex flexDirection="column"> doesn't change anything in the web UI, but when I try to use the web UI on this branch I get "theme.colors.blueGrey is undefined" after clicking on Connect.
Could you make sure that this change and the <React.Fragment> change don't cause problems for the web UI?
There was a problem hiding this comment.
I tested that change in the web UI as well...
If only I had noticed that I am testing on localhost:3080, not localhost:8080 🙄🙄
Fixed
07987d0 to
0469e21
Compare
ravicious
left a comment
There was a problem hiding this comment.
Also, forgot to mention that I totally forgot that the dropdown from the Web UI looks as if it was one of our pickers (an input at the top plus a list of possible results), but works in a completely different way. 😬 The input doesn't really limit down the list of possible options and so on.
But let's see what the team thinks about it. We can change that to a filterable list or something if it turns out to be a problem.
0469e21 to
8c8ce64
Compare
8c8ce64 to
0234cda
Compare
|
Force-push to re-trigger builds |
Closes https://github.com/gravitational/webapps.e/issues/146